<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box1 { width: 100%;height: 100px;transition:  all .5s;margin-top: 10px;}
    .box2 {background-color: brown; transition:  all .5s;}
    .box3 {box-shadow: 10px 10px 10px rgba(0, 0, 0, .5);transition:  all .5s;}
    .box4{display: flex;justify-content: center;align-items: center;color: #ffffff; font-size: 20px; transition:  all .5s;}
  </style>
</head>

<body>
  <div id="app">
    <button @click="isBox1=!isBox1">改变 isBox1</button>
    <button @click="isBox2=!isBox2">改变 isBox2</button>
    <button @click="isBox3=!isBox3">改变 isBox3</button>
    <button @click="isBox4=!isBox4">改变 isBox4</button>
    <!--对象语法：box1,box2,box3,box4这些class存在与否将取决于数据property的isActive的truthiness(布尔值) -->
    <div :class="{box1:isBox1,box2:isBox2,box3:isBox3,box4:isBox4}">动态绑定class对象语法</div>
    <div :class="{box1:true,box2:true,box3:true,box4:true}">动态绑定class对象语法</div>

  </div>
  <script src="../../javascript//vue.js"></script>
  <script>
    const vm = new Vue({
      el: "#app",
      data() {
        return {
          isBox1:true,
          isBox2:true,
          isBox3:true,
          isBox4:true
        }
      },
    })
  </script>
</body>

</html>